package com.kayt.cyberBar.cuser.business.entity.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * BDaily entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "b_daily")
public class BDaily implements java.io.Serializable, Comparable<BDaily> {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5824365277071979243L;
	// Fields

	private Long id;
	private String dailyCode;
	private String userCode;
	private String lateTimeCount;
	private String neglectTimeCount;
	private String lateTotal;
	private String neglectTotal;
	private String leaveTotal;
	private String holidayTotal;
	private String shiftTotal;
	private String workTimeCount;
	private String presetWorkTimeCount;
	private String ranking;
	private String workTimeRatio;
	private String month;
	private String createTime;
	private String updateTime;
	private String statusCode;
	private String checkScore;

	// Constructors

	/** default constructor */
	public BDaily() {
	}

	/** full constructor */
	public BDaily(String dailyCode, String userCode, String lateTimeCount, String neglectTimeCount, String lateTotal,
			String neglectTotal, String leaveTotal, String holidayTotal, String shiftTotal, String workTimeCount,
			String presetWorkTimeCount, String ranking, String month, String createTime, String updateTime,
			String statusCode, String checkScore) {
		this.dailyCode = dailyCode;
		this.userCode = userCode;
		this.lateTimeCount = lateTimeCount;
		this.neglectTimeCount = neglectTimeCount;
		this.lateTotal = lateTotal;
		this.neglectTotal = neglectTotal;
		this.leaveTotal = leaveTotal;
		this.holidayTotal = holidayTotal;
		this.shiftTotal = shiftTotal;
		this.workTimeCount = workTimeCount;
		this.presetWorkTimeCount = presetWorkTimeCount;
		this.ranking = ranking;
		this.month = month;
		this.createTime = createTime;
		this.updateTime = updateTime;
		this.statusCode = statusCode;
		this.checkScore = checkScore;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "DAILY_CODE", length = 64)
	public String getDailyCode() {
		return this.dailyCode;
	}

	public void setDailyCode(String dailyCode) {
		this.dailyCode = dailyCode;
	}

	@Column(name = "USER_CODE", length = 64)
	public String getUserCode() {
		return this.userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	@Column(name = "LATE_TIME_COUNT", length = 8)
	public String getLateTimeCount() {
		return this.lateTimeCount;
	}

	public void setLateTimeCount(String lateTimeCount) {
		this.lateTimeCount = lateTimeCount;
	}

	@Column(name = "NEGLECT_TIME_COUNT", length = 8)
	public String getNeglectTimeCount() {
		return this.neglectTimeCount;
	}

	public void setNeglectTimeCount(String neglectTimeCount) {
		this.neglectTimeCount = neglectTimeCount;
	}

	@Column(name = "LATE_TOTAL", length = 3)
	public String getLateTotal() {
		return this.lateTotal;
	}

	public void setLateTotal(String lateTotal) {
		this.lateTotal = lateTotal;
	}

	@Column(name = "NEGLECT_TOTAL", length = 3)
	public String getNeglectTotal() {
		return this.neglectTotal;
	}

	public void setNeglectTotal(String neglectTotal) {
		this.neglectTotal = neglectTotal;
	}

	@Column(name = "LEAVE_TOTAL", length = 3)
	public String getLeaveTotal() {
		return this.leaveTotal;
	}

	public void setLeaveTotal(String leaveTotal) {
		this.leaveTotal = leaveTotal;
	}

	@Column(name = "HOLIDAY_TOTAL", length = 3)
	public String getHolidayTotal() {
		return this.holidayTotal;
	}

	public void setHolidayTotal(String holidayTotal) {
		this.holidayTotal = holidayTotal;
	}

	@Column(name = "SHIFT_TOTAL", length = 3)
	public String getShiftTotal() {
		return this.shiftTotal;
	}

	public void setShiftTotal(String shiftTotal) {
		this.shiftTotal = shiftTotal;
	}

	@Column(name = "WORK_TIME_COUNT", length = 8)
	public String getWorkTimeCount() {
		return this.workTimeCount;
	}

	public void setWorkTimeCount(String workTimeCount) {
		this.workTimeCount = workTimeCount;
	}

	@Column(name = "PRESET_WORK_TIME_COUNT", length = 8)
	public String getPresetWorkTimeCount() {
		return this.presetWorkTimeCount;
	}

	public void setPresetWorkTimeCount(String presetWorkTimeCount) {
		this.presetWorkTimeCount = presetWorkTimeCount;
	}

	@Column(name = "RANKING", length = 8)
	public String getRanking() {
		return this.ranking;
	}

	public void setRanking(String ranking) {
		this.ranking = ranking;
	}

	@Column(name = "MONTH", length = 7)
	public String getMonth() {
		return this.month;
	}

	public void setMonth(String month) {
		this.month = month;
	}

	@Column(name = "CREATE_TIME", length = 32)
	public String getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	@Column(name = "UPDATE_TIME", length = 32)
	public String getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name = "STATUS_CODE", length = 32)
	public String getStatusCode() {
		return this.statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	@Column(name = "CHECK_SCORE", length = 8)
	public String getCheckScore() {
		return this.checkScore;
	}

	public void setCheckScore(String checkScore) {
		this.checkScore = checkScore;
	}

	@Column(name = "WORK_TIME_RATIO", length = 8)
	public String getWorkTimeRatio() {
		return workTimeRatio;
	}

	public void setWorkTimeRatio(String workTimeRatio) {
		this.workTimeRatio = workTimeRatio;
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(BDaily o) {
		Long thisTime = Long.parseLong(this.lateTimeCount) + Long.parseLong(this.neglectTimeCount);
		Long compareTime = Long.parseLong(o.lateTimeCount) + Long.parseLong(o.neglectTimeCount);
		if (thisTime > compareTime) {
			return 1;
		} else {
			return -1;
		}
	}

}